package com.cg.controller;

import com.cg.client.ItemClient;
import com.cg.dto.Dto;
import com.cg.dto.HotDto;
import com.cg.vo.*;
import com.cg.vo.floor.FloorItemsVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/p/index")
public class ItemController {

    @Resource
    private ItemClient itemClient;


    //获取所有的商品分类
    @PostMapping("/queryAllType")
    public Dto<List<ItemInfoVo>> findItemAll(){
        return itemClient.findItemAll();
    }


    //获取首页横向导航数据
    @PostMapping("/queryTransverse")
    public Dto<List<TransverseVo>> queryTransverse(){
        return itemClient.queryTransverse();
    }


    //首页轮播图接口
    @PostMapping("/queryBanner")
    public Dto<List<HotItems>> queryBanner(){
        return itemClient.queryBanner();
    }


    //今日推荐列表
    @PostMapping("/queryTodayRecommend")
    public Dto<List<BannerVo>> queryTodayRecommend(){
        return itemClient.queryTodayRecommend();
    }

    //即将开售列表
    @PostMapping("/queryToSaleItem")
    public Dto<List<BannerVo>> queryToSaleItem(){
        return itemClient.queryToSaleItem();
    }


    //首页返回不同楼层展示数据
    @PostMapping("/queryFloorItems")
    public Dto<List<FloorItemsVo>> queryFloorItems(){
        return itemClient.queryFloorItems();
    }
    //不同分类排行
    @PostMapping("/queryHotItems")
    public Dto<List<HotsVo>> queryHotitems(@RequestBody HotDto hotDto){
        return itemClient.queryHotitems(hotDto);
    }


}
